package dp.gr03.payroll.transactionFactory;

import java.util.GregorianCalendar;

import dp.gr03.payroll.affiliationTransactions.ChangeMemberTransaction;
import dp.gr03.payroll.affiliationTransactions.ChangeUnaffiliatedTransaction;
import dp.gr03.payroll.classificationTransaction.ChangeCommissionTransaction;
import dp.gr03.payroll.classificationTransaction.ChangeHourlyTransaction;
import dp.gr03.payroll.classificationTransaction.ChangeSalariedTransaction;
import dp.gr03.payroll.classificationTransaction.SalesReceiptTransaction;
import dp.gr03.payroll.classificationTransaction.TimecardTransaction;
import dp.gr03.payroll.generalTransactions.AddCommissionedEmployee;
import dp.gr03.payroll.generalTransactions.AddHourlyEmployee;
import dp.gr03.payroll.generalTransactions.AddSalariedEmployee;
import dp.gr03.payroll.generalTransactions.ChangeAddressTransaction;
import dp.gr03.payroll.generalTransactions.ChangeNameTransaction;
import dp.gr03.payroll.generalTransactions.DeleteEmployeeTransaction;
import dp.gr03.payroll.generalTransactions.PayDayTransaction;
import dp.gr03.payroll.methodTransactions.ChangeDirectTransaction;
import dp.gr03.payroll.methodTransactions.ChangeHoldTransaction;
import dp.gr03.payroll.methodTransactions.ChangeMailTransaction;
import dp.gr03.payroll.payrollApplication.Transaction;

public class TransactionFactoryImplementation implements TransactionFactory
{
    private static TransactionFactoryImplementation instance;

    private TransactionFactoryImplementation()
    {
    }

    public static TransactionFactoryImplementation getInstance()
    {
        if (instance == null)
        {
            instance = new TransactionFactoryImplementation();
        }
        return instance;
    }

    @Override
    public Transaction makeAddSalaryTransaction(int id, String name, String address, double salary)
    {
        return new AddSalariedEmployee(id, name, address, salary);
    }

    @Override
    public Transaction makeAddHouryEmployee(int employeeId, String name, String address, double hourlyRate)
    {
        return new AddHourlyEmployee(employeeId, name, address, hourlyRate);
    }

    @Override
    public Transaction makeAddCommisionedTransaction(int id, String name, String address, double salary, double commissionRate)
    {
        return new AddCommissionedEmployee(id, name, address, salary, commissionRate);
    }

    @Override
    public Transaction makeDeleteEmployeeTransaction(int employeeId)
    {
        return new DeleteEmployeeTransaction(employeeId);
    }

    @Override
    public Transaction makePaydayTransaction(GregorianCalendar payDate)
    {
        return new PayDayTransaction(payDate);
    }

    @Override
    public Transaction makeTimecardTransaction(GregorianCalendar date, double hours, int empId)
    {
        return new TimecardTransaction(date, hours, empId);
    }

    @Override
    public Transaction makeSalesReceiptTransaction(int empID, GregorianCalendar date, double amount)
    {
        return new SalesReceiptTransaction(empID, date, amount);
    }

    @Override
    public Transaction makeChangeHourlyTransaction(int empId, double hourlyRate)
    {
        return new ChangeHourlyTransaction(empId, hourlyRate);
    }

    @Override
    public Transaction makeChangeCommisionedTransaction(int empId, double commissionRate, double salary)
    {
        return new ChangeCommissionTransaction(empId, commissionRate, salary);
    }

    @Override
    public Transaction makeChangeSalariedTransaction(int empId, double salary)
    {
        return new ChangeSalariedTransaction(empId, salary);
    }

    @Override
    public Transaction makeChangeNameTransaction(int empId, String name)
    {
        return new ChangeNameTransaction(empId, name);
    }

    @Override
    public Transaction makeChangeAddressTransaction(int empId, String address)
    {
        return new ChangeAddressTransaction(empId, address);
    }

    @Override
    public Transaction makeChangeMailTransaction(int empId, String address)
    {
        return new ChangeMailTransaction(empId, address);
    }

    @Override
    public Transaction makeChangeDirectTransaction(int empId, String bank, String account)
    {
        return new ChangeDirectTransaction(empId, bank, account);
    }

    @Override
    public Transaction makeChangeHoldTransaction(int empId)
    {
        return new ChangeHoldTransaction(empId);
    }

    @Override
    public Transaction makeChangeMemberTransaction(int empId, int memberId, double dues)
    {
        return new ChangeMemberTransaction(empId, memberId, dues);
    }

    @Override
    public Transaction makeChangeUnaffiliatedTransaction(int empID)
    {
        return new ChangeUnaffiliatedTransaction(empID);
    }

}